package ru.chaykin.util;

import static ru.chaykin.logging.Log.LOG;

import java.awt.Container;

import ru.chaykin.config.AppConfig;

public class ContainerInstanceUtil {

	public static Container getContainer(String className) {
		try {
			Class<? extends Container> containerClass = Class.forName(className).asSubclass(Container.class);
			return containerClass.newInstance();
		} catch (Exception e) {
			LOG.error(AppConfig.getInstance().localizeErrString("ERR_LOAD_CONTAINER", className), e);
		}
		return null;
	}
}
